package com.youle.youleservice.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.apkfuns.logutils.LogUtils;
import com.youle.youleservice.activity.ForbiddenActivity;
import com.youle.youleservice.service.CoreService;
import com.youle.youleservice.util.ProcessUtil;

public class BootCompleBroadcastReceiver2 extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        LogUtils.e("ddddddddddddddddddddd BootCompleBroadcastReceiver2");
        String action = intent.getAction();
        if (action.equals("android.intent.action.BOOT_COMPLETED")){
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
           LogUtils.e("ddddddddddddddddddddd BootCompleBroadcastReceiver");
            startForbiddenActivity(context);
        }else {
            LogUtils.d("action-->"+action);
        }
    }

    private void startForbiddenActivity(Context context) {
        Intent intent = new Intent(context, ForbiddenActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }
}